home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Using C for real time data collection
- Date: Fri, 09 Feb 96 13:29:09 GMT
- Organization: none
- Message-ID: <823872549snz@genesis.demon.co.uk>
- References: <4fdou7$67e@usenet.srv.cis.pitt.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4fdou7$67e@usenet.srv.cis.pitt.edu>
- kbatch@rcn.wpic.pitt.edu "kbatch" writes:
-
- >I have a data collection program written mostly in C that uses stream
- >functions. Problem: someone inadvertantly shut off the computer during
- >data collection - all data was lost. The files are left open purposely
- >for data review and efficiency. I want to link with commode.obj. Will
- >the operating system (DOS) automatically commit the data to disk when
- >the stream buffer becomes full?
-
- Not necessarily. There are a lot of DOS specific issues here such as whether
- you have write-caching on the drive and whether DOS updates file information
- (such as recorded length) while the file is held open. You need to discuss
- these more fully but in a DOS related newsgroup.
-
- >Or, do I have to use a fflush after each
- >fwrite?
-
- If you want to be sure that the contents of the C stream buffers have been
- written out to the OS, yes, unless you set the stream to be non-buffered with
- setbuf or setvbuf. However fflush() does not force the OS to write the data
- to disk. For more information about DOS specifically try
- comp.os.msdos.programmer.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-